<template>
  <biz-form-remote-select
    :placeholder="placeholder"
    :remote-method="remoteMethod"
    :value="selectValue"
    cleared
    @input="updateSelectValue"
  >
  </biz-form-remote-select>
</template>

<script>
import { t } from '@src/locales';
export default {
  name: 'search-address-select',
  props: {
    placeholder: {
      type: String,
      default: t('product.form.validationTips.customerAddress')
    },
    remoteMethod: {
      type: Function
    },
    value: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      selectValue: this.value.slice()
    };
  },
  watch: {
    value(newValue) {
      this.selectValue = newValue.slice();
    }
  },
  methods: {
    updateSelectValue(value) {
      this.$emit('input', value);
    }
  }
};
</script>

<style lang="scss"></style>
